#define Flags CPU + 0
#define BranchSkip CPU + 4
#define NMIActive CPU + 5
#define IRQActive CPU + 6
#define WaitingForInterrupt CPU + 7
#define InDMA CPU + 8
#define InWRAM_DMA CPU + 9
#define WhichEvent CPU + 10
#define PCBase CPU + 12
#define PBPCAtOpcodeStart CPU + 16
#define WaitAddress CPU + 20
#define WaitCounter CPU + 24
#define Cycles CPU + 28
#define NextEvent CPU + 32
#define V_Counter CPU + 36
#define MemSpeed CPU + 40
#define MemSpeedx2 CPU + 44
#define FastROMSpeed CPU + 48
#define AutoSaveTimer CPU + 52
#define SRAMModified CPU + 56
#define BRKTriggered CPU + 57
#define TriedInterleavedMode2 CPU + 58
#define DB Registers + 0
#define PP Registers + 2
#define PL Registers + 2
#define PH PL + 1
#define AA Registers + 4
#define AL Registers + 4
#define AH AL + 1
#define DD Registers + 6
#define DL Registers + 6
#define DH DL + 1
#define SS Registers + 8
#define SL Registers + 8
#define SH SL + 1
#define XX Registers + 10
#define XL Registers + 10
#define XH XL + 1
#define YY Registers + 12
#define YL Registers + 12
#define YH YL + 1
#define PCR Registers + 16
#define PB Registers + 18
#define RAM Memory + 0
#define ROM Memory + 4
#define VRAM Memory + 8
#define SRAM Memory + 12
#define BWRAM Memory + 16
#define FillRAM Memory + 20
#define C4RAM Memory + 24
#define HiROM Memory + 28
#define LoROM Memory + 29
#define SRAMMask Memory + 32
#define SRAMSize Memory + 36
#define Map Memory + 40
#define WriteMap Memory + 16424
#define MemorySpeed Memory + 32808
#define BlockIsRAM Memory + 36904
#define BlockIsROM Memory + 41000
#define ROMFilename Memory + 53392
#define APUPCS IAPU + 0
#define APURAM IAPU + 4
#define APUExecuting IAPU + 12
#define APUDirectPage IAPU + 8
#define APUBit IAPU + 13
#define APUAddress IAPU + 16
#define APUWaitAddress1 IAPU + 20
#define APUWaitAddress2 IAPU + 24
#define APUWaitCounter IAPU + 28
#define APUShadowRAM IAPU + 32
#define APUCachedSamples IAPU + 36
#define APU_Carry IAPU + 40
#define APU_Zero IAPU + 41
#define APU_Overflow IAPU + 42
#define APUTimerErrorCounter IAPU + 44
#define NextAPUTimerPos IAPU + 48
#define APUCycles APU + 0
#define APUShowROM APU + 4
#define APUFlags APU + 8
#define APUKeyedChannels APU + 12
#define APUOutPorts APU + 13
#define APUDSP APU + 17
#define APUExtraRAM APU + 145
#define APUTimer APU + 210
#define APUTimerTarget APU + 216
#define APUTimerEnabled APU + 222
#define TimerValueWritten APU + 225
#define CPUSpeed ICPU + 0
#define CPUOpcodes ICPU + 4
#define _Carry ICPU + 12
#define _Zero ICPU + 13
#define _Negative ICPU + 14
#define _Overflow ICPU + 15
#define ShiftedDB ICPU + 24
#define ShiftedPB ICPU + 20
#define CPUExecuting ICPU + 16
#define Scanline ICPU + 32
#define Frame ICPU + 28
#define APUEnabled Settings + 0
#define Shutdown Settings + 1
#define SoundSkipMethod Settings + 2
#define HDMATimingHack Settings + 4
#define DisableIRQ Settings + 8
#define Paused Settings + 9
#define PAL Settings + 21
#define SoundSync Settings + 92
#define SA1Enabled Settings + 65
#define SuperFXEnabled Settings + 63
#define ApuP APURegisters + 0
#define ApuYA APURegisters + 2
#define ApuA APURegisters + 2
#define ApuY APURegisters + 3
#define ApuX APURegisters + 4
#define ApuS APURegisters + 5
#define ApuPC APURegisters + 6
#define APUPCR APURegisters + 6
#define BGMode PPU + 0
#define BG3Priority PPU + 1
#define Brightness PPU + 2
#define GHight PPU + 4
#define GInc PPU + 5
#define GAddress PPU + 6
#define GMask1 PPU + 8
#define GFullGraphicCount PPU + 10
#define GShift PPU + 12
#define CGFLIP PPU + 62
#define CGDATA PPU + 64
#define FirstSprite PPU + 576
#define LastSprite PPU + 577
#define OBJ PPU + 578
#define OAMPriorityRotation PPU + 2114
#define OAMAddr PPU + 2116
#define OAMFlip PPU + 2119
#define OAMTileAddress PPU + 2120
#define IRQVBeamPos PPU + 2122
#define IRQHBeamPos PPU + 2124
#define VBeamPosLatched PPU + 2126
#define HBeamPosLatched PPU + 2128
#define HBeamFlip PPU + 2130
#define VBeamFlip PPU + 2131
#define HVBeamCounterLatched PPU + 2132
#define MatrixA PPU + 2134
#define MatrixB PPU + 2136
#define MatrixC PPU + 2138
#define MatrixD PPU + 2140
#define CentreX PPU + 2142
#define CentreY PPU + 2144
#define CGADD PPU + 2150
#define FixedColourGreen PPU + 2152
#define FixedColourRed PPU + 2151
#define FixedColourBlue PPU + 2153
#define SavedOAMAddr PPU + 2154
#define ScreenHeight PPU + 2156
#define WRAM PPU + 2160
#define BG_Forced PPU + 2164
#define ForcedBlanking PPU + 2165
#define OBJThroughMain PPU + 2166
#define OBJThroughSub PPU + 2167
#define OBJSizeSelect PPU + 2168
#define OBJNameBase PPU + 2170
#define OAMReadFlip PPU + 2173
#define OAMData PPU + 2174
#define VTimerEnabled PPU + 2718
#define HTimerEnabled PPU + 2719
#define HTimerPosition PPU + 2720
#define Mosaic PPU + 2722
#define BGMosaic PPU + 2724
#define Mode7HFlip PPU + 2728
#define Mode7VFlip PPU + 2729
#define Mode7Repeat PPU + 2730
#define Window1Left PPU + 2731
#define Window1Right PPU + 2732
#define Window2Left PPU + 2733
#define Window2Right PPU + 2734
#define ClipWindowOverlapLogic PPU + 2741
#define ClipWindow1Enable PPU + 2747
#define ClipWindow2Enable PPU + 2753
#define ClipWindow1Inside PPU + 2759
#define ClipWindow2Inside PPU + 2765
#define RecomputeClipWindows PPU + 2771
#define CGFLIPRead PPU + 2772
#define OBJNameSelect PPU + 2774
#define Need16x8Mulitply PPU + 2776
#define RangeTimeOver PPU + 2118
#define ColorsChanged IPPU + 0
#define HDMA IPPU + 1
#define HDMAStarted IPPU + 2
#define MaxBrightness IPPU + 3
#define LatchedBlanking IPPU + 4
#define OBJChanged IPPU + 5
#define RenderThisFrame IPPU + 6
#define SkippedFrames IPPU + 20
#define FrameSkip IPPU + 24
#define TileCache IPPU + 28
#define TileCached IPPU + 56
#define VRAMReadBuffer IPPU + 84
#define Interlace IPPU + 86
#define DoubleWidthPixels IPPU + 89
#define RenderedScreenHeight IPPU + 92
#define RenderedScreenWidth IPPU + 96
#define Red IPPU + 100
#define Green IPPU + 1124
#define Blue IPPU + 2148
#define XB IPPU + 3172
#define ScreenColors IPPU + 3176
#define PreviousLine IPPU + 3688
#define CurrentLine IPPU + 3692
#define Clip IPPU + 3696
#define SA1Opcodes SA1 + 0
#define SA1_Carry SA1 + 8
#define SA1_Zero SA1 + 9
#define SA1_Negative SA1 + 10
#define SA1_Overflow SA1 + 11
#define SA1CPUExecuting SA1 + 12
#define SA1ShiftedPB SA1 + 16
#define SA1ShiftedDB SA1 + 20
#define SA1Flags SA1 + 24
#define SA1Executing SA1 + 28
#define SA1NMIActive SA1 + 29
#define SA1IRQActive SA1 + 30
#define SA1WaitingForInterrupt SA1 + 31
#define SA1PCBase SA1 + 36
#define SA1PBPCAtOpcodeStart SA1 + 44
#define SA1WaitAddress SA1 + 48
#define SA1WaitCounter SA1 + 52
#define SA1WaitByteAddress1 SA1 + 56
#define SA1WaitByteAddress2 SA1 + 60
#define SA1BWRAM SA1 + 40
#define SA1Map SA1 + 64
#define SA1WriteMap SA1 + 16448
#define SA1op1 SA1 + 32832
#define SA1op2 SA1 + 32834
#define SA1arithmetic_op SA1 + 32836
#define SA1sum SA1 + 32840
#define SA1overflow SA1 + 32848
#define VirtualBitmapFormat SA1 + 32849
#define SA1_in_char_dma SA1 + 32850
#define SA1variable_bit_pos SA1 + 32851
#define SA1DB SA1Registers + 0
#define SA1PP SA1Registers + 2
#define SA1PL SA1Registers + 2
#define SA1PH SA1PL + 1
#define SA1AA SA1Registers + 4
#define SA1AL SA1Registers + 4
#define SA1AH SA1AL + 1
#define SA1DD SA1Registers + 6
#define SA1DL SA1Registers + 6
#define SA1DH SA1DL + 1
#define SA1SS SA1Registers + 8
#define SA1SL SA1Registers + 8
#define SA1SH SA1SL + 1
#define SA1XX SA1Registers + 10
#define SA1XL SA1Registers + 10
#define SA1XH SA1XL + 1
#define SA1YY SA1Registers + 12
#define SA1YL SA1Registers + 12
#define SA1YH SA1YL + 1
#define SA1PB SA1Registers + 18
#define SA1PCR SA1Registers + 16
